/*
 * @Author: 1453937336@qq.com 1453937336@qq.com
 * @Date: 2024-04-30 09:50:24
 * @LastEditors: 1453937336@qq.com 1453937336@qq.com
 * @LastEditTime: 2024-06-13 19:05:37
 * @FilePath: \itforce-hris\src\store\modules\menuSetting.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const state: any = {
    state: {
        menuState: false,
        userData: {},
        showEmp: false,
        userMenuName: null
    },
}

const mutations: any = {
    // 设置全局个人信息菜单
    SET_MENU_STATE(state: any, menuState: Boolean) {
        state.menuState = menuState
    },
    SET_USER_DATA(state: any, userData: any) {
        state.userData = userData
    },
    SET_SHOWEMP_STATE(state: any, showEmp: Boolean) {
        state.showEmp = showEmp
    },
    SET_USER_MENU_NAME(state: any, userMenuName: String) {
        state.userMenuName = userMenuName
    },

}

const actions = {
    // 设置全局个人信息菜单
    SET_MENU_STATE({ commit }: any, menuState: Boolean) {
        commit('SET_MENU_STATE', menuState)
    },
    SET_USER_DATA({ commit }: any, userData: any) {
        commit('SET_USER_DATA', userData)
    },
    SET_SHOWEMP_STATE({ commit }: any, showEmp: Boolean) {
        commit('SET_SHOWEMP_STATE', showEmp)
    },
    SET_USER_MENU_NAME({ commit }: any, userMenuName: String) {
        commit('SET_USER_MENU_NAME', userMenuName)
    },
}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}
